/* 游戏界面样式 */
#game-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 800px;
}

/* HUD样式 */
#game-hud {
    display: flex;
    justify-content: space-between;
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.hud-item {
    text-align: center;
}

.hud-label {
    font-size: 0.9rem;
    color: #bdc3c7;
    margin-right: 5px;
}

#wpm-display, #accuracy-display, #time-display, #item-display {
    font-weight: bold;
    font-size: 1.1rem;
}

/* 打字区域样式 */
#typing-area {
    background-color: #34495e;
    color: #ecf0f1;
    padding: 20px;
    border: 1px solid #2c3e50;
    border-radius: 0;
    flex: 1;
    overflow: hidden;
    position: relative;
}

#text-display {
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
}

.typed {
    color: #7f8c8d;
}

.current {
    background-color: #f1c40f;
    color: #2c3e50;
    border-radius: 2px;
}

.error {
    background-color: #e74c3c;
    color: white;
    border-radius: 2px;
}

#cursor {
    position: absolute;
    width: 2px;
    height: 1.8rem;
    background-color: #3498db;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 游戏场景样式 */
#game-scene {
    height: 200px;
    background-color: #2c3e50;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
}

/* 角色样式 */
#thief-character, #police-character {
    position: absolute;
    bottom: 20px;
    height: 80px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* 小偷基础样式 */
.thief-character {
    left: 20%;
}

.thief-character::before {
    content: '👤';
    font-size: 40px;
}

/* 小偷走路状态 */
.thief-walking::before {
    content: '🚶';
    font-size: 40px;
}

/* 小偷跑步状态 */
.thief-running::before {
    content: '🏃';
    font-size: 40px;
}

/* 小偷骑摩托状态 */
.thief-motorcycle::before {
    content: '🏍️';
    font-size: 40px;
}

/* 小偷开车状态 */
.thief-car::before {
    content: '🚗';
    font-size: 40px;
}

/* 警察样式 */
.police-character {
    right: 10%;
}

.police-character::before {
    content: '👮';
    font-size: 40px;
}

.police-character::after {
    content: '';
    position: absolute;
    top: -15px;
    right: -5px;
    width: 20px;
    height: 10px;
    background: linear-gradient(90deg, transparent, #e74c3c, transparent);
    border-radius: 5px;
    animation: police-light 0.5s infinite alternate;
}

@keyframes police-light {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* 踉跄效果 */
.stumble {
    animation: stumble-effect 0.5s ease;
}

@keyframes stumble-effect {
    0% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-10px) rotate(-10deg); }
    50% { transform: translateY(0) rotate(5deg); }
    75% { transform: translateY(-5px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0); }
}

#distance-bar {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 10px;
    background-color: #34495e;
    border-radius: 5px;
}

#distance-indicator {
    height: 100%;
    width: 80%;
    background-color: #3498db;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* 鼓励文字样式 */
.encouragement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}
